<div class="page" id="index">
	<h3>Latest News</h3>
	<table>
		<?php if(count($this->view->data) > 0) { ?>
			<?php foreach($this->view->data as $idx => $one) { ?>
				<tr>
					<td class="author">
						<?php echo $this->partial('helpers/avatar.php', array(
							'size' => 40,
							'user' => array(
								'id' => $one['author_id'],
								'link' => $one['author_link'],
								'name' => $one['author_name'],
								'avatar' => $one['author_avatar']
							)
						)); ?>
						<div class="clear"></div>
					</td>
					<td class="reply">
						<div class="meta">
							<h4><a href="forum/topic/<?php echo $one['link']; ?>" data-to="ajax"><?php echo $one['name']; ?></a></h4>
							<span>By: <a data-to="ajax" href="profile/view/<?php echo $one['author_link']; ?>"><?php echo $one['author_name']; ?></a> <span class="bull">&bull;</span> Posted: <?php echo $this->partial('helpers/time.php', array('time' => $one['time'])); ?> <span class="bull">&bull;</span> <a href="forum/topic/<?php echo $one['comments_link']; ?>" data-to="ajax"><?php echo $one['comments'] . ($one['comments'] == 1 ? ' Comment' : ' Comments'); ?></a></span>
						</div>
						<div class="msg"><?php echo $one['message']; ?></div>
					</td>
				</tr>
				<?php if(count($this->view->data) != $idx + 1) { ?>
					<tr><td colspan="2" class="delimiter"></td></tr>
				<?php } ?>
			<?php } ?>
			<?php if(count($this->view->pagination) > 1) { ?>
				<tr><td colspan="2" class="delimiter"></td></tr>
				<tr>
					<td colspan="2" class="post">
						<div class="center"><?php echo $this->partial('helpers/pagination.php', array('url' => 'index', 'pagination' => $this->view->pagination)); ?></div>
					</td>
				</tr>
			<?php } ?>
		<?php } else { ?>
			No news topics found.
		<?php } ?>
	</table>
</div>